import request from '@/utils/request'

export default {
  removeCourseById(id) {
    return request({
      url: `/admin/edu/course/remove`,
      method: 'delete',
      params: { id: id }
    })
  },
  getPageList(page, limit, searchObj) {
    return request({
      url: `/admin/edu/course/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  saveCourseInfo(courseInfo) {
    return request({
      url: `/admin/edu/course/save/courseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  getCourseInfoById(courseId) {
    return request({
      url: `/admin/edu/course/get/${courseId}`,
      method: 'get'
    })
  },

  getCoursePublishInfoById(id) {
    return request({
      url: `/admin/edu/course/get/publishCourseInfo/${id}`,
      method: 'get'
    })
  },

  publishCourseById(id) {
    return request({
      url: `/admin/edu/course/publishCourse/${id}`,
      method: 'put'
    })
  },

  checkCourse(id,checkResult) {
    return request({
      url: `/admin/edu/course/checkCourse/${id}/${checkResult}`,
      method: 'put'
    })
  }
}
